home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Players / StillView / stillviewDlg.h < prev   
Encoding:
C/C++ Source or Header  |  2001-10-09  |  3.9 KB  |  135 lines

  1. //------------------------------------------------------------------------------
  2. // File: StillViewDlg.h
  3. //
  4. // Desc: DirectShow sample code - dialog header file for the StillView
  5. //       application.
  6. //
  7. // Copyright (c) 1998 - 2001, Microsoft Corporation.  All rights reserved.
  8. //------------------------------------------------------------------------------
  9.  
  10. #if !defined(AFX_StillViewDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
  11. #define AFX_StillViewDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_
  12.  
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif // _MSC_VER > 1000
  16.  
  17. #include <dshow.h>
  18.  
  19.  
  20. // Application-defined messages
  21. #define WM_GRAPHNOTIFY  WM_APP + 1
  22. #define WM_FIRSTFILE    WM_APP + 2
  23. #define WM_PLAYFILE     WM_APP + 3
  24. #define WM_NEXTFILE     WM_APP + 4
  25. #define WM_PREVIOUSFILE WM_APP + 5
  26.  
  27. //
  28. // Macros
  29. //
  30. #define SAFE_RELEASE(i) {if (i) i->Release(); i = NULL;}
  31.  
  32. #define JIF(x) if (FAILED(hr=(x))) \
  33.     {RetailOutput(TEXT("FAILED(0x%x) ") TEXT(#x) TEXT("\n"), hr); goto CLEANUP;}
  34.  
  35. // Function prototypes
  36. void RetailOutput(TCHAR *tszErr, ...);
  37.  
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CStillViewDlg dialog
  41.  
  42. class CStillViewDlg : public CDialog
  43. {
  44. // Construction
  45. public:
  46.     CStillViewDlg(CWnd* pParent = NULL);    // standard constructor
  47.  
  48.     HRESULT PrepareMedia(LPTSTR lpszMovie);
  49.     HRESULT InitDirectShow(void);
  50.     HRESULT FreeDirectShow(void);
  51.     HRESULT HandleGraphEvent(void);
  52.     HRESULT EnumFilters(void);
  53.     HRESULT EnumPins(IBaseFilter *pFilter, PIN_DIRECTION PinDir, CListBox& Listbox);
  54.  
  55.     IBaseFilter * FindFilterFromName(LPTSTR szName);
  56.  
  57.     BOOL DisplayFileInfo(LPTSTR szFile);
  58.     BOOL DisplayImageInfo(void);
  59.     BOOL SupportsPropertyPage(IBaseFilter *pFilter);
  60.  
  61.     LONG GetDXMediaPath(TCHAR *strPath);
  62.     LONG GetGraphEditPath(TCHAR *szPath);
  63.     void InitMediaDirectory(void);
  64.     void FillFileList(LPTSTR pszCmdLine);
  65.  
  66.     void ResetDirectShow(void);
  67.     void CenterVideo(void);
  68.     void PlayNextFile(void);
  69.     void PlayPreviousFile(void);
  70.     void PlaySelectedFile(void);
  71.  
  72.     // Dialog Data
  73.     //{{AFX_DATA(CStillViewDlg)
  74.     enum { IDD = IDD_STILLVIEW_DIALOG };
  75.     CStatic    m_StrFileTime;
  76.     CStatic    m_StrImageSize;
  77.     CEdit    m_EditMediaDir;
  78.     CSpinButtonCtrl    m_SpinFiles;
  79.     CButton    m_ButtonProperties;
  80.     CStatic    m_StrMediaPath;
  81.     CStatic    m_StrFileDate;
  82.     CStatic    m_StrFileSize;
  83.     CListBox    m_ListPinsOutput;
  84.     CListBox    m_ListPinsInput;
  85.     CStatic    m_StrFileList;
  86.     CStatic    m_Screen;
  87.     CListBox    m_ListInfo;
  88.     CListBox    m_ListFilters;
  89.     CListBox    m_ListFiles;
  90.     //}}AFX_DATA
  91.  
  92.     // ClassWizard generated virtual function overrides
  93.     //{{AFX_VIRTUAL(CStillViewDlg)
  94.     protected:
  95.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  96.     virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  97.     //}}AFX_VIRTUAL
  98.  
  99. // Implementation
  100. protected:
  101.     HICON m_hIcon;
  102.     int   m_nCurrentFileSelection;
  103.     TCHAR m_szCurrentDir[MAX_PATH];
  104.  
  105.     IGraphBuilder *m_pGB;
  106.     IMediaControl *m_pMC;
  107.     IBasicVideo   *m_pBV;
  108.     IVideoWindow  *m_pVW;
  109.     IMediaEventEx *m_pME;
  110.  
  111.     // Generated message map functions
  112.     //{{AFX_MSG(CStillViewDlg)
  113.     virtual BOOL OnInitDialog();
  114.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  115.     afx_msg void OnPaint();
  116.     afx_msg HCURSOR OnQueryDragIcon();
  117.     afx_msg void OnClose();
  118.     afx_msg void OnDestroy();
  119.     afx_msg void OnSelectFile();
  120.     afx_msg void OnSelchangeListFilters();
  121.     afx_msg void OnDblclkListFilters();
  122.     afx_msg void OnButtonProppage();
  123.     afx_msg void OnDeltaposSpinFiles(NMHDR* pNMHDR, LRESULT* pResult);
  124.     afx_msg void OnButtonSetMediadir();
  125.     afx_msg void OnButtonGraphedit();
  126.     afx_msg BOOL OnEraseBkgnd(CDC *);
  127.     //}}AFX_MSG
  128.     DECLARE_MESSAGE_MAP()
  129. };
  130.  
  131. //{{AFX_INSERT_LOCATION}}
  132. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  133.  
  134. #endif // !defined(AFX_StillViewDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
  135.